-- @owner: @zou_jialiang050
-- @date: 2022/09/15
-- @testpoint: show create trigger修改sql_mode查看显示正确性

--step1:建表及触发器;expect:成功
drop table if exists t_show_create_trigger_0010;
create table t_show_create_trigger_0010(c1 int);
create or replace function f_show_create_trigger_0010() returns trigger
as $$
    declare
    begin
           delete from t_show_create_trigger_0010;
           return new;
    end
$$ language plpgsql;
/

drop trigger if exists tri_show_create_trigger_0010 on t_show_create_trigger_0010;
create trigger tri_show_create_trigger_0010
          after truncate on t_show_create_trigger_0010
          for each statement
          execute procedure f_show_create_trigger_0010();
/

--step2:show create trigger修改sql_mode查看显示正确性;expect:成功
show create trigger tri_show_create_trigger_0010;
set dolphin.sql_mode='sql_mode_strict';
show create trigger tri_show_create_trigger_0010;


--step3:清理环境;expect:成功
drop trigger if exists tri_show_create_trigger_0010 on t_show_create_trigger_0010;
drop view if exists v_show_create_trigger_0010;
drop table if exists t_show_create_trigger_0010 cascade;
drop function if exists f_show_create_trigger_0010;
reset dolphin.sql_mode;
